package com.company;

/**
 * @description:
 * @author: Lenovo
 * @date: Crcoted in 2020/05/16 15:13
 * @version:${VERSION}
 * @modified By:
 */
public class Person extends Creature {
    private Room currentRoom;
    @Override
    public void useArticle(Weapon weapon, Creature badCreature) {
        weapon.useArticle(badCreature);
    }
     public Person(){}

    public void go (String targetRoomId) {
        //临时变量
        Room room;
        //1.根据targetRoomId找相应的目标房间
        room= currentRoom.searchReachableRoomById(targetRoomId,currentRoom.getReachableRooms());
        if (room != null) {
            //2.如果找到房间，将该Room赋给Person.currentRoom
            this.currentRoom=room;
            //显示人所在的当前房间可到达的房间
            Ui.displayReachableRooms(this);
        } else {
            //如果没有找到房间，显示没有目标房间
            Ui.printNoRoom();
        }
    }
    public Person(String id, String description, int hp, Weapon currentWeapon) {
        super(id, description, hp, currentWeapon);
    }


    public Room getCurrentRoom() {
        return currentRoom;
    }

    public void setCurrentRoom(Room currentRoom) {
        this.currentRoom = currentRoom;
    }
}